
importPackage(com.blocks.blocks);
importPackage(com.blocks);
importPackage(com.blocks.model);
importPackage(com.jme3.math);
importPackage(java.lang);
importPackage(com.blocks.script);
importPackage(com.jme3.math);
importPackage(com.jme3.collision);
importPackage(com.jme3.scene.debug);
importPackage(com.jme3.scene);
importPackage(com.jme3.material);
importPackage(com.blocks.gui);




var MAX_HEIGTH = 50;
var block = new Object(); 

block.setup = function(name) {
 	thisBlock.setName("Balloon");
 	thisBlock.setTextureRow(1.0);
	thisBlock.setTextureColumn(3.0);
 	thisBlock.resetTexture();
 	thisBlock.setBlockListGroup(BlockListGroup.MODEL);
	
  } 
block.loop = function(name, tpf) { 
	if(thisBlock.isPowered()){
				masterBlock = ScriptBlocksApplication.getInstance().getMasterBlock(thisBlock.getMasterId());
				var force = thisBlock.getFrequency(thisBlock.getBlockSides())*tpf;
				if(!(thisBlock.getWorldTranslation().getY()>MAX_HEIGTH)){
					var moveto = masterBlock.getLocalTranslation().add(Vector3f.UNIT_Y.mult(force));
					masterBlock.setLocalTranslation(moveto);
				} 

	}
	
 }


block.scriptExport = function() {
	return ("");
} 

 

